<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>我的购物车</title>
</head>
<body onload="productCount()">
	<div id="nav">您的位置：<a href="#">首页</a> > <a href="#">我的书皇</a> > 我的购物车</div>
				<div id="navlist">
				  <ul>
				    <li class="navlist_red_left"></li> 
				    <li class="navlist_red">1. 查看购物车</li> 
				    <li class="navlist_red_arrow"></li>
				    <li class="navlist_gray">2. 确认订单信息</li> 
				    <li class="navlist_gray_arrow"></li> 
				     <li class="navlist_gray">3. 付款到支付宝</li> 
				    <li class="navlist_gray_arrow"></li>   
				     <li class="navlist_gray">4. 确认收货</li> 
				    <li class="navlist_gray_arrow"></li> 
				    <li class="navlist_gray">5. 评价</li> 
				    <li class="navlist_gray_right"></li>   
				  </ul>
				</div>
				
				<div id="content">
					 <form action="" method="post" name="myform">
						 <table width="100%" border="0" cellspacing="0" cellpadding="0" id="shopping">
						  <tr>
						    <td class="title_1"><input id="allCheckBox" type="checkbox" value="" onclick="selectAllByCart()" />全选</td>
						    <td class="title_2" colspan="2">店铺宝贝</td>
						    <td class="title_3">获积分</td>
						    <td class="title_4">单价（元）</td>
						    <td class="title_5">数量</td>
						    <td class="title_6">小计（元）</td>
						    <td class="title_7">操作</td>
						  </tr>
						  <tr>
						    <td colspan="8" class="line"></td>
						  </tr>
						  <!-- 总价 -->
						  <s:set name="sumPrice" value="0"></s:set>
						  <!-- 积分 -->
						  <s:set name="sumIntegral" value="0"></s:set>
						  <s:iterator value="books" var="book_list" status="index_num" >
						  		<!-- 计算小计 -->
						  		<s:set name="tatol" value="#book_list.total*#book_list.price"></s:set>
						  		<s:set value="#sumPrice=#sumPrice+#tatol"></s:set>
						  		<s:set value="#sumIntegral=#sumIntegral+#book_list.integral"></s:set>
						  	   <tr>
							   	 <td colspan="8" class="shopInfo">店铺：<a href="#">红豆豆的小屋</a>    卖家：<a href="#">taobao豆豆</a> <img src="/image/shop/taobao_relation.jpg" alt="relation" /></td>
							   </tr>
							   <tr id="product${index_num.index}">
								    <td class="cart_td_1"><input id="${book_list.id}" name="cartCheckBox" type="checkbox" value="product${index_num.index}" onclick="selectSingle()" /></td>
								    <td class="cart_td_2"><div style="width: 100px;height: 120px;overflow: hidden;"><img src="${book_list.logo}" alt="shopping" width="100"/></div></td>
								    <td class="cart_td_3"><a href="#">${book_list.bookName}</a><br />
								        	保障：<img src="images/taobao_icon_01.jpg" alt="icon" /></td>
								    <td class="cart_td_4">${book_list.integral}</td>
								    <td class="cart_td_5">${book_list.price}</td>
								    <td class="cart_td_6">
								    	<img src="/image/shop/taobao_minus.jpg" alt="minus" onclick="changeNum('num_${index_num.index}','minus','${book_list.id }')" class="hand"/> 
								    	<input id="num_${index_num.index}" type="text"  value="${book_list.total}" class="num_input" readonly="readonly"/> 
								    	<img src="/image/shop/taobao_adding.jpg" alt="add" onclick="changeNum('num_${index_num.index}','add','${book_list.id }')"  class="hand"/>
								    </td>
								    <td class="cart_td_7"><s:property value="#tatol"/> </td>
								    <td class="cart_td_8"><a href="javascript:deleteRow('product${index_num.index}','${book_list.id }');">删除</a></td>
							  </tr>
						  </s:iterator>
						   <tr>
						   <td  colspan="3" style="text-align: left;"><a href="javascript:deleteSelectRow()"><img src="/image/shop/taobao_del.jpg" alt="delete"/></a></td>
						    <td colspan="5" class="shopend">商品总价（不含运费）：<label id="total" class="yellow"><s:property value="#sumPrice"/></label> 元<br />
						    	可获积分 <label class="yellow" id="integral"><s:property value="#sumIntegral"/> </label> 点<br />
						    <input name=" " type="image" src="/image/shop/taobao_subtn.jpg" /></td>
						  </tr>
						 
						</table>
					 </form>
				</div>
</body>
</html>